<template>
	<view class="service_cc">
	    <button class="cs_button margin-bottom-20" open-type="contact">
	        <image src="@/static/kefu.png" class="cs_image"></image>
	    </button>
	    <button class="cs_button" @click="toPhone" v-if="phone">
	        <image src="@/static/phone.png" class="cs_image"></image>
	    </button>
	</view>
</template>

<script>
	import {Util} from '@/utils/util.js'
	export default {
		data() {
			return {phone:undefined}
		},
		mounted() {
			this.$nextTick(function(){
				this.phone=Util.getCache("shopPhone");
			});
		},
		methods: {
			toPhone(event){
				uni.makePhoneCall({
					phoneNumber:this.phone
				});
			}
		}
	}
</script>

<style lang="scss">
	.service_cc{position: fixed;right: 0rpx;bottom:20%;width:69px;
		.cs_button {
		  background-color:transparent;
		  border: 0px;
		  height: 100rpx;
		  &:after {
		    border: 0px;
		  }
		}
		.cs_image {
		  height: 80rpx;
		  width: 80rpx;
		}
	}
</style>
